{% extends "projects/project_edit_base.html" %}

{% load static %}
{% load i18n %}

{% block title %}{% trans "Automation Rule" %}{% endblock %}

{% block nav-dashboard %} class="active"{% endblock %}

{% block project-automation-rules-active %}active{% endblock %}
{% block project_edit_content_header %}{% trans "Automation Rule" %}{% endblock %}


{% block extra_scripts %}
  <script src="{% static "projects/js/automation-rules.js" %}"></script>
  <script type="text/javascript">
    require('projects/automation-rules');
  </script>
{% endblock %}

{% block project_edit_content %}
  <form
      method="post"
      class="form-wide"
      action=".">
    {% csrf_token %}
    {{ form.as_p }}
    <input type="submit" value="{% trans "Save" %}">
  </form>

  {% if object.pk %}
  <form method="post" action="{% url 'projects_automation_rule_delete' object.project.slug object.pk %}">
    {% csrf_token %}
    <input type="submit" value="{% trans "Delete" %}">
  </form>
  {% endif %}

{% endblock %}
